/*
 * Main.fx
 *
 * Created on 12-May-2010, 12:50:16
 */

package com.googlecode.snorkel;

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.paint.Color;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;

/**
 * @author brian
 */

// Create our SplashScreen and display node
var splashScreen = SplashScreen{};
var splash;
// Create our headerMenu and display node
var headerMenu = HeaderMenu{};
var header;
// Create our Content and display node
public var contentMain = Content{};
var content;

var t1 = Timeline {
   keyFrames : [
      KeyFrame { time: 0s action: function():Void{ splash = splashScreen;  } }, //splashScreen.fadeInSplash(); } },
      KeyFrame { time: 4s action: function():Void{ splashScreen.fadeOutSplash(); } },
      KeyFrame { time: 6s action: function():Void{ header = headerMenu; headerMenu.fadeInHeader(); } },
      KeyFrame { time: 6s action: function():Void{ content = contentMain; contentMain.fadeInContent(); } },
   ]
};





public function hello(message:String){println({message})}


function run(){
   t1.play();
   Stage {
      title: "SNorkel"
      scene: Scene {
         fill: LinearGradient {
            startX: 0.0
            startY: 0.0
            endX: 0.0
            endY: 1.0
            stops: [
               Stop {
                  color: Color.web("#0c8ec4") //Color.BLACK
                  offset: 0.0
               },
               Stop {
                  color: Color.web("#0a1945") //Color.GRAY
                  offset: 1.0
               },
            ]
         }
         width: 800
         height: 600
         content: bind [splash,header,content]
      }
   }
}